博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
小程序animation动画效果综合应用案例(交流QQ群:604788754)
阅读量:7086 次
发布时间:2019-06-28

本文共 1714 字,大约阅读时间需要 5 分钟。

如果案例有问题,可到QQ群找到今日相关压缩文件下载测试。

WXML:

电话
发布
咨询

WXSS:

.cebian {  width: 50px;  height: auto;  display: flex;  flex-direction: column;  position: fixed;  bottom: 60px;  right: 20px;  z-index: 10;  overflow: hidden;}.anniu{  position: relative;  left: 50px;}.cebian01, .cebian02,.cebian03,.cebian04 {  height: 50px;  width: 50px;  text-align: center;  line-height: 50px;  border-radius: 60px;  color: #fff;}.cebian02,.cebian03,.cebian04{  margin-top: 10px;}.cebian01{  background-color: #50cb67;}.cebian02{  background-color: #6785e5;}.cebian03{  background-color: #ec4149;}.cebian04{  background-color: #949494;  position: relative;}.cebian04>image{  width: 30px;  height: 30px;  position: relative;  top: 10px;  }

JS:

Page({  data: {    jiantous: false,    anniuimg: '/picture/jiantou01.png',  },  /*右侧按钮部分效果*/  onReady: function () {    this.animation = wx.createAnimation();    this.animations = wx.createAnimation()  },  anniuhide: function () {    var leftjian = this.data.jiantous;    if (leftjian == false) {      this.animation.translate(50, 0).step();      this.animations.rotate(180).translate(3,0).step();      leftjian = true;    } else {      this.animation.translate(0, 0).step();      this.animations.rotate(0).translate(0, 0).step();      leftjian = false;    }    this.setData({      animation: this.animation.export(),      animations: this.animations.export(),      jiantous: leftjian,    });  },})

效果图:

转载于:https://www.cnblogs.com/yiweiyihang/p/7119540.html

你可能感兴趣的文章
《深入PHP:面向对象、模式与实践》(一)
查看>>
[06] JavaScript 类型
查看>>
求最大值及其下标
查看>>
关于类型“LinkButton”的控件“xxx”必须放在具有 runat=server 的窗体标记内问题的解决方案...
查看>>
Javascript:DOM表格操作
查看>>
解决WCF传输大数据量时出错并提示:远程主机强迫关闭了一个现有的连接
查看>>
蓝桥杯-波动数列
查看>>
图片理论基础
查看>>
HDU4300 Clairewd’s message
查看>>
【原】iOS学习之图片拉伸处理(类似qq的气泡)
查看>>
postman抓包
查看>>
最大稳定极值区域(MSER)检测
查看>>
如何解决CorelDRAW中尖突问题
查看>>
Javascript实现Web颜色值转换
查看>>
拼接日期填写表单
查看>>
工控系统安全问题汇总(一)
查看>>
4、SpringBoot------邮件发送(2)
查看>>
java创建二叉树并递归遍历二叉树
查看>>
JSON必知必会
查看>>
安全站点导航
查看>>